package utility_menu

import (
	"Sailor/app/Sailor-console-server/internal/model/entity"
)

var m []entity.SysMenu

// MenuFormat 菜单处理
func MenuFormat(menu []entity.SysMenu) []entity.SysMenu {
	var a []entity.SysMenu
	for _, v := range menu {
		v.Meta.Icon = v.Icon
		v.Meta.Title = v.Title
		v.Meta.Type = v.Type
		v.Meta.IsHide = v.IsHide
		v.Meta.IsFull = v.IsFull
		v.Meta.IsAffix = v.IsAffix
		v.Meta.IsKeepAlive = v.IsKeepAlive
		v.Meta.Active = v.Active
		if v.Children != nil {
			v.Children = MenuFormat(v.Children)
		}
		a = append(a, v)
	}
	return a
}
